package com.jinjiafeng.enjoyjoke;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

/**
 * @author jinjiafeng
 * Time :18-6-3
 */
public class TitleFragment extends Fragment {

    public static TitleFragment newInstance(String title) {
        Bundle args = new Bundle();
        TitleFragment fragment = new TitleFragment();
        args.putString("title",title);
        fragment.setArguments(args);
        return fragment;
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        final View view = inflater.inflate(R.layout.framgnt_title, container,false);
       TextView textView =  view.findViewById(R.id.tv_title);
        textView.setText(getArguments().getString("title"));
        return view;

    }
}
